Hệ thống quản lý trường đại học bằng PHP

1 <?php require('../includes/config.php'); ?>
2 <!DOCTYPE HTML>
3 <html>
4 <head>
5     <title>Institut national des sciences appliquées et de technologie</title>
6     <meta charset=
"utf-8" />
7     <meta name=
"viewport" content="width=device-width, initial-scale=1" />
8     <!--[
if lte IE 8]><script src="assets/js/ie/html5shiv.js"></script><![endif]-->
9     <link rel=
"stylesheet" href="assets/css/main.css" />
10     <!--[
if lte IE 9]><link rel="stylesheet" href="assets/css/ie9.css" /><![endif]-->
11     <!--[
if lte IE 8]><link rel="stylesheet" href="assets/css/ie8.css" /><![endif]-->
12
13 </head>
14 <body>
15
16     <!-- Wrapper -->
17     <div id=
"wrapper">
18     <?php require(
'../includes/header.php'); ?>
19         
20
21         <!-- Main -->
22         <div id=
"main">
23
24             <!-- Post -->
25             <?php
26             
try {
27
28                 $requested_page = isset($_GET[
'page']) ? intval($_GET['page']) : 1;
29
30                 $reqw = $db->query(
'SELECT COUNT(*) FROM blog_posts');
31                 $script_name = $_SERVER[
'PHP_SELF'];
32                 
33                 $resp = $reqw->fetch();
34                 $article_count=$resp[
0];
35                 $articles_per_page =
2;
36
37                 $page_count = ceil(intval($article_count) / $articles_per_page);
38
39
40                 
if ( !is_int($requested_page) || $requested_page < 1 || $requested_page > $page_count ) {
41                     $requested_page=
1;
42                 }
43                 $first_article_shown = ($requested_page -
1) * $articles_per_page;
44
45                 $stmt = $db->query(
"SELECT * FROM blog_posts ORDER BY postID DESC LIMIT $first_article_shown, $articles_per_page");
46                 
while($row = $stmt->fetch()){
47             ?>
48                     <article
class="post">
49                         <header>
50                             <div
class="title">
51                                 <h2><a href=<?php echo
"viewpost.php?id=".$row['postID'] ?>> <?= $row['postTitle'] ?> </a></h2>
52                             </div>
53                             <div
class="meta">
54                                 <time
class="published"><?php echo date('jS M Y H:i:s', strtotime($row['postDate'])) ?></time>
55                             </div>
56                         </header>
57                         <?php
58                             
if ($row['image'] != "") {
59                                 echo
'<img src="content/'.$row['image'].'" alt="" />';
60                             }
61                          ?>
62                         <p><?php echo $row[
'postDesc'] ?></p>
63                         <footer>
64                             <ul
class="actions">
65                                 <li><a href=<?php echo
"viewpost.php?id=".$row['postID'] ?> class="button big">Continue Reading</a></li>
66                             </ul>
67                             <ul
class="stats">
68                                 <li><a href=
"#">General</a></li>
69                                 <li><a href=
"#" class="icon fa-heart">28</a></li>
70                                 <li><a href=
"#" class="icon fa-comment">128</a></li>
71                             </ul>
72                         </footer>
73                     </article>
74             <?php
75                 }
76
77             }
catch(PDOException $e) {
78                 echo $e->getMessage();
79             }
80             ?>
81
82
83             <!-- Pagination -->
84             <ul
class="actions pagination">
85                 <?php
86                 
if ($requested_page == 1) {
87                     echo
'<li><a href="#" class="disabled button big previous">Previous Page</a></li>';
88                 }
89                 
else{
90                     $new_page=$requested_page -
1;
91                     echo
'<li><a href="'.$script_name.'?page='.$new_page.'" class=" button big previous">Previous Page</a></li>';
92                 
93                 }
94
95                 
if ($requested_page == $page_count) {
96                     echo
'<li><a href="#" class="disabled button big next">Next Page</a></li>';
97                 }
98                 
else{
99                     $new_page=$requested_page +
1;
100                     echo
'<li><a href="'.$script_name.'?page='.$new_page.'" class=" button big next">Next Page</a></li>';
101                 }
102                 
103                 ?>
104             </ul>
105
106         </div>
107
108         <!-- Sidebar -->
109         <section id=
"sidebar">
110
111             <!-- Intro -->
112             <section id=
"intro">
113                 <!-- <a href=
"#" class="logo"><img src="images/logo.jpg" alt="" /></a> -->
114                 <header>
115                     <h2>INSAT</h2>
116                     <p>institut national des sciences appliquées et de technologie</p>
117                 </header>
118             </section>
119
120             <!-- Mini Posts -->
121             <section>
122                 <div
class="mini-posts">
123                 <?php
124                     
try {
125
126                     $stmt = $db->query(
'SELECT eventID, eventDateAndTime, eventPoster, eventTitle FROM Events ORDER BY eventDateAndTime DESC');
127                 
while($row = $stmt->fetch()){
128                 ?>
129
130                     <!-- Mini Post -->
131                     <article
class="mini-post">
132                         <header>
133                             <h3><a href=
"#"><?= $row['eventTitle'] ?> </a></h3>
134                             <time
class="published" datetime="2015-10-20"><?php echo date('jS M Y H:i:s', strtotime($row['eventDateAndTime'])) ?></time>
135                         </header>
136                         <a href=
"#" class="image"><?php
137                             
if ($row['eventPoster'] != "") {
138                                 echo
'<img src="content/Events/'.$row['eventPoster'].'" alt="Not Found" />';
139                             }
140                          ?></a>
141                     </article>
142
143                 <?php
144                     }
145
146                 }
catch(PDOException $e) {
147                         echo $e->getMessage();
148                     }
149                 ?>
150                 </div>
151             </section>
152
153             <!-- About -->
154             <section
class="blurb">
155                 <h2>About</h2>
156                 <p>The National Institute of Applied Sciences and Technology (INSAT)
is a Tunisian institute that is affiliated with the University of Carthage.Admission is very competitive and generally students must hold a good average on the national exam to be admitted. Training technicians and engineers, it provides a post-baccalaureate education over a period of three and five years.</p>
157                 <ul
class="actions">
158                     <li><a href=
"https://en.wikipedia.org/wiki/National_Institute_of_Applied_Science_and_Technology" class="button">Learn More</a></li>
159                 </ul>
160             </section>
161
162             <!-- Footer -->
163             <section id=
"footer">
164                 <ul
class="icons">
165                     <li><a href=
"https://github.com/Khyol/project-WEB" class="fa-github"><span class="label">GITHUB</span></a></li>
166                     <li><a href=
"mailto:ghazi.ben.dahmen@outlook.com" class="fa-envelope"><span class="label">Email</span></a></li>
167                 </ul>
168                 <p
class="copyright">&copy;Designed by: <a href="https://www.facebook.com/nadhem.fekihhassen">Nadhem Fekih Hassen</a> ,<a href="https://www.facebook.com/gbendahmen">Ghazi Ben Dahmen</a></p>
169             </section>
170
171         </section>
172
173     </div>
174
175     <!-- Scripts -->
176     <script src=
"assets/js/jquery.min.js"></script>
177     <script src=
"assets/js/skel.min.js"></script>
178     <script src=
"assets/js/util.js"></script>
179     <!--[
if lte IE 8]><script src="assets/js/ie/respond.min.js"></script><![endif]-->
180     <script src=
"assets/js/main.js"></script>
181 <!-- Javascript Libs -->
182     <script type=
"text/javascript" src="../../lib/js/jquery.min.js"></script>
183     <script type=
"text/javascript" src="../../lib/js/bootstrap.min.js"></script>
184     <script type=
"text/javascript" src="../../lib/js/Chart.min.js"></script>
185     <script type=
"text/javascript" src="../../lib/js/bootstrap-switch.min.js"></script>
186
187     <script type=
"text/javascript" src="../../lib/js/jquery.matchHeight-min.js"></script>
188     <script type=
"text/javascript" src="../../lib/js/jquery.dataTables.min.js"></script>
189     <script type=
"text/javascript" src="../../lib/js/dataTables.bootstrap.min.js"></script>
190     <script type=
"text/javascript" src="../../lib/js/select2.full.min.js"></script>
191     <script type=
"text/javascript" src="../../lib/js/ace/ace.js"></script>
192     <script type=
"text/javascript" src="../../lib/js/ace/mode-html.js"></script>
193     <script type=
"text/javascript" src="../../lib/js/ace/theme-github.js"></script>
194     <!-- Javascript -->
195     <script type=
"text/javascript" src="../../js/app.js"></script>
196 </body>
197 </html>


Gõ tìm kiếm nhanh...